package practice;

import java.util.concurrent.*;

/**
 * @AUTHOR LYF
 * @DATE 2022/2/12
 * @VERSION 1.0
 * @DESC
 * 线程池的使用及原理（原理图）
 * 七大参数，四大策略（
 *
 */
public class ThreadPoolDemo {
    public static void main(String[] args) {
        Executors.newFixedThreadPool(3);//三种方式
        Executors.newCachedThreadPool();//一般不用
        Executors.newScheduledThreadPool(3);

       ExecutorService executorService = new ThreadPoolExecutor(2,5,2L, TimeUnit.SECONDS,
               new LinkedBlockingQueue<>(),Executors.defaultThreadFactory(),new ThreadPoolExecutor.AbortPolicy());



    }
}
